<?php

class Model_Orm_Movie_Tests extends \PHPUnit_Framework_TestCase
{
    public function test_movieadd1()
    {
        $data = array(
            'Title_Lv' => 'Filmas nosaukums',
            'Title_En' => 'a',
            'Title_Original' => 'Nosaukums oriģinālvalodā',
            'Description_Lv' => 'A',
            'Description_En' => 'Description',
            'Year' => 2014,
            'Age_Restriction' => 10,
            'Duration' => 100,
            'Poster' => 'poster.jpg'
        );

        $validation = Model_Orm_Movie::validate('add1');

        if($validation->run($data) === false) {
            throw new Orm\ValidationFailed(implode(' * ', e((array) $validation->error())));
        }
    }
    
    public function test_movieadd2()
    {
        $data = array(
            'Title_Lv' => 'Filmas nosaukums',
            'Title_En' => 'a',
            'Title_Original' => 'Nosaukums oriģinālvalodā',
            'Description_Lv' => 'A',
            'Description_En' => 'Description',
            'Year' => 2014,
            'Age_Restriction' => 10,
            'Duration' => 100,
            'Poster' => 'poster.jpg'
        );

        $validation = Model_Orm_Movie::validate('add2');

        if($validation->run($data) === false) {
            throw new Orm\ValidationFailed(implode(' * ', e((array) $validation->error())));
        }
    }
}